package com.sxj.corejava.code09_集合.set;

import java.util.Arrays;
import java.util.Set;
import java.util.TreeSet;

/**
 * @author 石小俊
 * @date 2025年02月19日
 */
public class Test06_Comparable {

    public static void main(String[] args) {
        User user = new User("admin", 18);
        User user2 = new User("jack", 20);
        User user3 = new User("tom", 20);
        User user4 = new User("lucy", 19);
        User user5 = new User("alex", 21);
        User user6 = new User("alice", 18);
        Set<User> set = new TreeSet<>(Arrays.asList(user, user2, user3, user4, user5, user6));
        System.out.println(set);
    }

}
